home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / drivexx.exe / DRVDEMO.INC < prev    next >
Text File  |  1993-01-22  |  6KB  |  167 lines

  1. PROCEDURE ShowDriveError;
  2.  var ans : char;
  3.  begin
  4.   if DriveError <> 0 then
  5.   begin
  6.    writeln('Error ',DriveError,' detected in UpdateDrives procedure: ');
  7.    if ((DriveError and 01) <> 0) then
  8.       writeln('Wrong DOS version (must be 3.0 or higher)');
  9.    if ((DriveError and 02) <> 0) then
  10.       writeln('Not enough memory to create DRIVES^');
  11.    if ((DriveError and 04) <> 0) then
  12.       writeln('Function 52h returns NULL pointer');
  13.    if ((DriveError and 08) <> 0) then
  14.       writeln('Inconsistency in undocumented function (joined drives)');
  15.  
  16.    if ((DriveError and 16) <> 0) then
  17.       writeln('Unknown error');
  18.  
  19.    if ((DriveError and 32) <> 0) then
  20.       writeln('Number of drives exceeds 32');
  21.    if ((DriveError and 64) <> 0) then
  22.       writeln('Inconsistency in undocumented function (network drives)');
  23.    if ((DriveError and 128) <> 0) then
  24.       writeln('$440E failed, bit 6 of device driver attribute set');
  25.    if ((DriveError and 256) <> 0) then
  26.       writeln('INT13 F08h failed for known AT class processor');
  27.    if ((DriveError and 512) <> 0) then
  28.       writeln('INT13 F08h returned 0 in register BL for unknown reasons');
  29.    if ((DriveError and 1024) <> 0) then
  30.       writeln('INT13 F08h returned out-of-range value in register BL');
  31.    if ((DriveError and 2048) <> 0) then
  32.       writeln('$4408 failed, bit 11 of device driver attribute set');
  33.    if ((DriveError and 4096) <> 0) then
  34.       writeln('$440D failed, bit 6 of device driver attribute set');
  35.    if ((DriveError and 8192) <> 0) then
  36.       writeln('Mismatched drive numbers');
  37.    if ((DriveError and 16384) <> 0) then
  38.       writeln('Error counting units in device driver');
  39.    if ((DriveError and 32768) <> 0) then
  40.       writeln('Total devices > 32');
  41.    if ((DriveError and 65536) <> 0) then
  42.       writeln('Totaldevices <> NumBlockDevs');
  43.    if ((DriveError and 131072) <> 0) then
  44.       writeln('Error getting NetWare drive map table');
  45.    if ((DriveError and 262144) <> 0) then
  46.       writeln('DevicesperDriver <> CountDrives');
  47.    if ((DriveError and 524288) <> 0) then
  48.       writeln('Unknown error');
  49.    if ((DriveError and 1048576) <> 0) then
  50.       writeln('Device driver address not found');
  51.    writeln;
  52.    write('Press ''C'' to continue, anything else to quit. ');
  53.    readln(ans);
  54.    if (ans <> 'C') and (ans <> 'c') then halt;
  55.   end;
  56.  end;
  57.  
  58.  
  59. function cursorline : byte;
  60. var regs : registers;
  61. begin
  62.   regs.ax := $0F00;
  63.   Intr($10,regs);
  64.   regs.ax := $0300;
  65.   Intr($10,regs);
  66.   cursorline := regs.dh + 1;
  67. end;
  68.  
  69. procedure writehex(bt : byte);
  70. const
  71.   hexdigits : array[0..15] of char = '0123456789ABCDEF';
  72. var
  73.   bz : byte;
  74. begin
  75.   bz := bt and $0F;
  76.   bt := bt shr 4;
  77.   write(hexdigits[bt],hexdigits[bz]);
  78. end;
  79.  
  80. procedure positioncursor;
  81. begin
  82.   if cursorline >= 21 then
  83.   begin
  84.     gotoxy(1,24);
  85.     write('==> Press ENTER to continue ');
  86.     readln;
  87.     clrscr;
  88.     writeln;
  89.   end;
  90. end;
  91.  
  92.  
  93. procedure openingscreen;
  94. begin
  95.   textcolor(white);
  96.   writeln('DRVDEMO - DRIVExx Demo Program, Copyright (C) 1991, 1992 by FeerKnott Computing');
  97.   textcolor(lightgray);
  98.   window(1,2,80,25);
  99.   writeln;
  100.  
  101.   write(  'Operating System..............................: ');
  102.   if DRDOS then write('DR DOS') else write('MS DOS');
  103.   writeln(' version ',DOSVER:4:2);
  104.   writeln('BIOS Date.....................................: ',BiosDateString);
  105.   write(  'Processor Type................................: ');
  106.   case ProcessorType of
  107.     1 : writeln('8088/8086');
  108.     2 : writeln('80286');
  109.     3 : writeln('80386');
  110.    -3 : writeln('80386SX');
  111.     4 : writeln('80486');
  112.     else writeln('Unknown (',ProcessorType,')');
  113.   end; {case}
  114.   write('Machine ID....................................: ');writehex(MachineID);
  115.     writeln;
  116.  
  117.   writeln;
  118.   writeln('Valid Logical Drives..........................: ',alllogicaldrives);
  119.   writeln('Bootable Drives...............................: ',bootabledrives);
  120.   writeln;
  121.   writeln('Number of BIOS-driven Internal Floppies.......: ',Internalfloppies);
  122.   writeln('Valid Floppy Drives...........................: ',floppies);
  123.   writeln;
  124.   writeln('Number of Hard Disks Installed................: ',PhysicalFixed);
  125.   writeln('Valid Hard Disk Partitions....................: ',hards);
  126.   writeln;
  127.   if (not NetWareLoaded) then
  128.   writeln('Current default drive and path................: ',CurrentDir(defaultdrive));
  129.  
  130.   gotoxy(1,24);
  131.   textcolor(white);
  132.   write('Press ENTER to see individual drive characteristics ...');
  133.   textcolor(lightgray);
  134.   readln;clrscr;
  135. end; {openingscreen}
  136.  
  137.  
  138. procedure showdpbdata(D : fakedpb);
  139. begin
  140.   with D do 
  141.   begin
  142.     writeln;
  143.     writeln('Unit number within device driver : ',ddunitnum);
  144.     writeln('                Bytes per Sector : ',bytespersex);
  145.     writeln('             Sectors per Cluster : ',sexperclust);
  146.     writeln('                  Number of FATs : ',numFATS);
  147.     writeln('                 Sectors per FAT : ',sexperFAT);
  148.     writeln('                First FAT sector : ',FATStart);
  149.     writeln('Number of root directory entries : ',RootdirEnts);
  150.     writeln('     First root directory sector : ',rootstart);
  151.     writeln('      Sectors per root directory : ',RootdirSex);
  152.     writeln;
  153.     writeln('       First data sector on disk : ',FirstDataSec);
  154.     writeln(' Number of data clusters on disk : ',TotDataclusts);
  155.     writeln('             Number of cylinders : ',cylinders);
  156.     writeln('               Sectors per track : ',sexpertrack);
  157.     writeln;
  158.     writeln('           Media descriptor byte : ',mediabyte);
  159.     write  ('                     Access flag : ',accessflag);
  160.     if accessflag <> 0 then writeln('  (NOT ACCESSED SINCE BOOTUP)')
  161.                       else writeln;
  162.     writeln('                  DPB data valid : ',dpbdatavalid);
  163.     writeln;
  164.   end;
  165. end;
  166.  
  167.